package heima.gasStation;

public class Card {
    private String licensePlate;
    private String name;
    private int phoneNumber;
    private double money;

    public Card() {}

    public Card(String licensePlate, String name, int phoneNumber, double money) {
        this.licensePlate = licensePlate;
        this.name = name;
        this.phoneNumber = phoneNumber;
        this.money = money;
    }

    public String getLicensePlate() {
        return licensePlate;
    }

    public void setLicensePlate(String licensePlate) {
        this.licensePlate = licensePlate;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(int phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public boolean consume(double cost){
        if (this.money >= cost){
            this.money -= cost;
            return true;
        } else return false;
    }

    public boolean charge(double money){
        this.money += money;
        return true;
    }
}
